-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Import check_time_locks() and CoinRecord #19848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hey Matt, I'm a little worried that all these rust function calls to access struct members is going to slow everything down (even slower than the old python structure). Is pyo3 efficient at this? Have you done any performance tests? |
df85ac7
to
35e64a6
Compare
Changed this to no longer require function calls as the Rust implementation now uses |
35e64a6
to
0236cf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to no longer require function calls as the Rust implementation now uses
#[getter]
to mark functions as properties
just to be clear, this just avoids the ()
in code. it doesn't make things faster (at least from a python perspective). my default take on that is that it hides the fact that code is executing and that properies should primarily be used for deprecation of attribute access when you need to add code and are transitioning to using a method exclusively.
but... i think it can be argued that we are doing exactly that here and that the diff is much more comprehensible as such. i might suggest a follow-up though to move away from the getter to a method.
suggested follow-ups, specifically separate for diff clarity around each change:
- getter to method
- remove
CoinRecord = RustCoinRecord
self.max_tx_clvm_cost, | ||
self.constants, | ||
self.peak.height, | ||
flags | MEMPOOL_MODE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because this branch is based off Arvid's PR to bump the chia_rs version:
https://github.com/Chia-Network/chia-blockchain/pull/19953/files#diff-ee823ddd491e7037efb6bda95223e6e4aa703239fd08f28c54a6e3a51b75ff42L449
I agree about removing the old coin_record.py file and the exported re-name. Implemented now. |
d44d4c9
to
3c7e456
Compare
Purpose:
check_time_locks()
and CoinRecord have now been ported to Rust so this PR migrates chia-blockchain to use the new portMust come after a new version of chia_rs implements these changes
Current Behavior:
New Behavior:
Testing Notes: